/*
 */
package gclib;

import gclib.inventory.Armor;
import java.util.EnumMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**Classes.java
 * 
 * Created Jul 23, 2009 7:52:15 PM
 * @author Jason
 */
public class Classes {
    public static enum TYPE {Cleric, FIGHTER};
    private static final Map<TYPE, Class> classes = new EnumMap<TYPE, Class>(TYPE.class);
	private static final PowerKeywordMap pkm = new PowerKeywordMap(PowerKeyword.class);

    private Classes(){
		Class clazz;

		//=Cleric
		clazz = new Class();
		clazz.setHpPerLvl(5);
		clazz.getArmorProficiencies().add(Armor.TYPE.CLOTH);
		clazz.getArmorProficiencies().add(Armor.TYPE.LEATHER);
		clazz.getArmorProficiencies().add(Armor.TYPE.HIDE);
		clazz.getArmorProficiencies().add(Armor.TYPE.CHAINMAIL);
		clazz.getWeaponProficiencies().add(WeaponGroup.TYPE.SIMPLE_MELEE);
		clazz.getWeaponProficiencies().add(WeaponGroup.TYPE.SIMPLE_RANGE);

		//Channel Divinity
		Feature feat = new Feature();
		feat.setName("Channel Divinity: Divine Fortune");
		feat.setClassFeature(true);
		feat.setFlavorText("In the face of peril, you hold true to your faith and receive a special boon.");
		feat.setClassType(TYPE.Cleric);
		feat.setActionType(Feature.ACTION_TYPE.FREE_ACTION);
		feat.setAttackRange(Feature.ATTACK_RANGE.PERSONAL);
		feat.getKeywords().add(PowerKeyword.DIVINE);
		feat.setUsage(Feature.USAGE.ENCOUNTER);
		feat.getEffects().add(new PowerEffect("You gain a {} bonus to your next attack roll or saving throw before the end of your next turn.", new Integer[]{1}));
		
		clazz.getClassFeatures().add(feat);//Channel Divinity

		//Healer's Lore
		clazz.getClassFeatures().add(null);//Healer's Lore

		//Healing Word
		feat = new Feature();
		feat.setName("Healing Word");
		feat.setClassFeature(true);
		feat.setClassType(TYPE.Cleric);
		feat.setUsage(Feature.USAGE.ENCOUNTER);
		feat.setFlavorText("You whisper a brief prayer as divine light washes over your target, helping to mend its wounds.");
		feat.getKeywords().add(PowerKeyword.DIVINE);
		feat.getKeywords().add(PowerKeyword.HEALING);
		feat.setActionType(Feature.ACTION_TYPE.MINOR_ACTION);
		feat.setAttackType(Feature.ATTACK_TYPE.CLOSE);
		feat.setAttackRange(Feature.ATTACK_RANGE.BURST);
		feat.setAttackRangeValue(5);
		feat.setTarget("You or one ally");
		feat.getEffects().add(new PowerEffect("The target can spend a healing surge and regain an additional {} hit points.", new String[]{"1d6"}));
		clazz.getClassFeatures().add(null);//healing word
		clazz.getClassFeatures().add(null);//Ritual Casting
		clazz.getTrainedSkills().add(null);//Religion
		clazz.getTrainedSkills().add(null);//Arcana
		clazz.getTrainedSkills().add(null);//Diplomacy
		clazz.getTrainedSkills().add(null);//Heal
		clazz.getTrainedSkills().add(null);//History
		clazz.getTrainedSkills().add(null);//Insight
		clazz.getTrainedSkills().add(null);//Religion
		clazz.getDefenseBonsuses().put("Will", new Integer(2));
        classes.put(TYPE.Cleric, clazz);

		clazz = new Class();
		clazz.setHpPerLvl(6);
		clazz.getArmorProficiencies().add(Armor.TYPE.CLOTH);
		clazz.getArmorProficiencies().add(Armor.TYPE.LEATHER);
		clazz.getArmorProficiencies().add(Armor.TYPE.HIDE);
		clazz.getArmorProficiencies().add(Armor.TYPE.CHAINMAIL);
		clazz.getArmorProficiencies().add(Armor.TYPE.SCALE);
		clazz.getArmorProficiencies().add(Armor.TYPE.LIGHT_SHIELD);
		clazz.getArmorProficiencies().add(Armor.TYPE.HEAVY_SHIELD);
		clazz.getWeaponProficiencies().add(WeaponGroup.TYPE.SIMPLE_MELEE);
		clazz.getWeaponProficiencies().add(WeaponGroup.TYPE.MILITARY_MELEE);
		clazz.getWeaponProficiencies().add(WeaponGroup.TYPE.SIMPLE_RANGE);
		clazz.getWeaponProficiencies().add(WeaponGroup.TYPE.MILITARY_RANGE);
		clazz.getClassFeatures().add(null);//Combat Challenge
		clazz.getClassFeatures().add(null);//Combat Superiority
		clazz.getClassFeatures().add(null);//Fighter Weapon Talent
		clazz.getTrainedSkills().add(null);//Athletics
		clazz.getTrainedSkills().add(null);//Endurance
		clazz.getTrainedSkills().add(null);//Heal
		clazz.getTrainedSkills().add(null);//Intimidate
		clazz.getTrainedSkills().add(null);//Streetwise
		clazz.getDefenseBonsuses().put("Fortitude", new Integer(2));
		classes.put(TYPE.FIGHTER, clazz);

    }

    public static Class getClass(TYPE type){
        return classes.get(type);
    }

	public static Classes getInstance(){
		return ClassHolder.INSTANCE;
	}
	
	private static class ClassHolder {
		private static final Classes INSTANCE = new Classes();
	}
}
